package com.neutech.controller;

import com.neutech.service.DepartmentService;
import com.neutech.service.TdoctorService;
import com.neutech.service.SchedulService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@CrossOrigin
@RestController
public class TdoctorController {
//    @Autowired
//    private MenuService menuService;
    /*******************医生___START*************************/
    @Autowired
    private TdoctorService tdoctorService;
    @RequestMapping("/queryTdoctor")
    public List<Map<String,Object>> getTdoctor(){
        return tdoctorService.queryTdoctor();
    }
    @RequestMapping("/insertTdoctor")
    public void insTdoctor(@RequestParam Map  map){
        tdoctorService.insertTdoctor(map);
        System.out.println(map.get("docid"));
    }
    @RequestMapping("/deleteTdoctor")
    public void delTdoctor(@RequestParam Map  map){
        tdoctorService.deleteTdoctor(map);
        System.out.println(map.get("docid"));
    }
    @RequestMapping("/updataTdoctor")
    public void updTdoctor(@RequestParam Map  map){
//        System.out.println("看这里");
//        System.out.println(map);
//        System.out.println("看这里");
        Map<String,Object> map2 = new HashMap<>();
        map2.put("tid",map.get("tid"));
        map2.put("department",map.get("department"));
        map2.put("sex",map.get("sex"));
        map2.put("account-number",map.get("account-number"));
        map2.put("password",map.get("password"));
        tdoctorService.updataTdoctor(map2);
    }
    /**************************END*******************************/

}
